/*
@Copyright:LintCode
@Author:   tjyemail
@Problem:  http://www.lintcode.com/problem/two-strings-are-anagrams
@Language: C++
@Datetime: 16-02-09 05:22
*/

class Solution {
public:
    /**
     * @param s: The first string
     * @param b: The second string
     * @return true or false
     */
    bool anagram(string s, string t) {
        // write your code here
        int hash[256]={0};
        for(int i=0;i<s.length();++i)
            hash[s[i]]++;
        for(int i=0;i<t.length();++i)
            hash[t[i]]--;
        for(int i=0;i<256;++i)
            if (hash[i])
                return false;
        return true;
    }
};